﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.Skins;
using DevExpress.LookAndFeel;
using DevExpress.UserSkins;
using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraBars.Helpers;


namespace GUI2
{
    public partial class FrmMainControler : RibbonForm
    {
        FrmMainGuest Guest;
        public FrmMainControler(FrmMainGuest Guest)
        {
            this.Guest = Guest;
            InitializeComponent();
            InitSkinGallery();
        }
        void InitSkinGallery()
        {
            SkinHelper.InitSkinGallery(rgbiSkins, true);
        }

        private void btnSanPham_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (var frm in MdiChildren) if (frm is Controler.FrmSanpham) return;
            var frmSanpham = new Controler.FrmSanpham() { MdiParent = this };
            frmSanpham.Show();
        }

        private void btnExit_ItemClick(object sender, ItemClickEventArgs e)
        {
            foreach (var frm in MdiChildren) frm.Close();
        }

        private void FrmMainControler_FormClosed(object sender, FormClosedEventArgs e)
        {
            Dispose();
            Guest.Show();
        }
    }
}